{include file="public:header"/}
<!--编辑小区-->
<form id="info_form" action="{:url('editDo')}" method="post" enctype="multipart/form-data">
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
            <li class="current">基本信息</li>
            <li>基础数据</li>
            <li>SEO设置</li>
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th width="120">所属区域 :</th>
                        <td>
                            <select class="J_cate_select mr10" data-pid="0" data-menuid="1" data-uri="{:url('City/ajaxGetchilds')}" data-selected="{$info.city}|{$info.area}"></select>
                            <input type="hidden" name="area" id="J_cate_id" value="" />
                        </td>
                    </tr>
		            <tr>
						<th>小区名称 :</th>
						<td>
							<input type="text" name="title" id="J_title" value="{$info.title}" class="input-text" size="40">
					       </td>
					</tr>
                    <tr>
                        <th>建筑年代 :</th>
                        <td><input type="text" name="niandai" id="niandai" value="{$info.niandai}" class="input-text" size="10" />年</td>
                    </tr>
                    <tr>
                        <th>小区类型 :</th>
                        <td>{:getLinkMenu(7,'estate_type','checkbox',explode(',',$info['estate_type']))}</td>
                    </tr>

                    <tr>
                        <th>地图标注：</th>
                        <td>
                            <input type="text" name="map" id="map" class="input-text" size="27" value="{$info.lng},{$info.lat}"/>
                            &nbsp;&nbsp;<a href="http://api.map.baidu.com/lbsapi/getpoint/" style="padding: 8px;color:#ffffff;background: #008000" target="_blank">获取百度地图坐标</a>
                        </td>
                    </tr>

                    <tr>
                        <th>小区地址 :</th>
                        <td><input type="text" name="address" value="{$info.address}" id="address" class="input-text" size="40"/> </td>
                    </tr>

		            <tr>
						<th>缩略图:</th>
						<td>
                            {notempty name='info.img'}
                            <img src="{$info.img}" alt="" width="150" /><br />
                            {/notempty}
                            <input type="file" name="img" id="img" class="input-text"  style="width:200px;" /> 图片尺寸：310*200</td>
		 			</tr>
                    <tr>
                        <th>小区图片 :</th>
                        <td><script id="uploadpic" name="uploadpic" type="text/plain"></script>
                            <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                            <div id="imageList">
                                <ul class="list clearfix">
                                    {volist name="info.file" id="vo"}
                                    <li>
                                        <img width="113" height="113" alt="{$vo.title}" src="{$vo.url}">
                                        <input type="hidden" value="{$vo.url}" name="pic[pic][]">
                                        <input type="text" class="imgtitletxt" value="{$vo.title}" name="pic[alt][]">
                                        <div class="delbox"><span class="del">删除</span></div>
                                    </li>
                                    {/volist}
                                </ul>
                            </div>
                        </td>
                    </tr>

					<tr>
						<th>状态 :</th>
                        <td>
                            <label><input type="radio" name="status" class="radio_style" value="1" {if condition="$info.status eq 1"}checked="checked"{/if}> 启用 </label>&nbsp;&nbsp;
                            <label><input type="radio" name="status" class="radio_style" value="0" {if condition="$info.status eq 0"}checked="checked"{/if}>禁用</label>
                        </td>
					</tr>
                    <tr>
                        <th>介绍 :</th>
                        <td>
                            <script id="info" name="data[info]" type="text/plain">{$detail.info}</script>
                        </td>
                    </tr>
				</table>
			</div>
            <div class="content_list pad_10 hidden">
                <table width="100%" cellspacing="0" class="table_form">
                    <tr>
                        <th>小区概况 :</th>
                        <td>
                            <table width="88%"  cellspacing="0" class="table_form">
                                <tr>
                                    <th width="100">建筑类别：</th>
                                    <td><input type="text" name="data[attr][jzlb]" value="{$detail['attr']['jzlb']}" class="input-text" size="20" /></td>
                                    <th width="100">装修情况：</th>
                                    <td><input type="text" name="data[attr][zxqk]" value="{$detail['attr']['zxqk']}" class="input-text"  size="20" /></td>
                                    <th width="100">产　　权：</th>
                                    <td><input type="text" name="data[attr][chanquan]" value="{$detail['attr']['chanquan']}" class="input-text"  size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">户　　数：</th>
                                    <td><input type="text" name="data[attr][hushu]" value="{$detail['attr']['hushu']}" class="input-text" size="20" /></td>
                                    <th width="100">容 积 率：</th>
                                    <td><input type="text" name="data[attr][rjl]" value="{$detail['attr']['rjl']}" class="input-text" size="20" /></td>
                                    <th width="100">开 发 商：</th>
                                    <td><input type="text" name="data[attr][kfs]" value="{$detail['attr']['kfs']}" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">绿 化 率：</th>
                                    <td><input type="text" name="data[attr][lhl]" value="{$detail['attr']['lhl']}" class="input-text"  size="20" /></td>
                                    <th width="100">物业公司：</th>
                                    <td><input type="text" name="data[attr][wygs]" value="{$detail['attr']['wygs']}" class="input-text" size="20" /></td>
                                    <th width="100">车    位：</th>
                                    <td><input type="text" name="data[attr][chewei]" value="{$detail['attr']['chewei']}" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">物 业 费：</th>
                                    <td><input type="text" name="data[attr][wuyefee]" value="{$detail['attr']['wuyefee']}" class="input-text"  size="20" /></td>
                                    <th width="100">楼盘朝向：</th>
                                    <td><input type="text" name="data[attr][loupanzhaoxiang]" value="{$detail['attr']['loupanzhaoxiang']}" class="input-text" size="20" /></td>
                                    <th width="100">物业类型：</th>
                                    <td><input type="text" name="data[attr][wylx]" value="{$detail['attr']['wylx']}" class="input-text" size="20" /></td>
                                </tr>
                                <tr>
                                    <th width="100">道路交通：</th>
                                    <td colspan="5"><textarea name="data[attr][daolujiaotong]" style="width: 780px;height: 66px;"> {$detail['attr']['daolujiaotong']}</textarea></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <th>配套信息 :</th>
                        <td>
                            <table width="88%"  cellspacing="0" class="table_form">
                                <tr>
                                    <th style="width: 100px;">学校：</th>
                                    <td><textarea name="data[peitao][xuexiao]" style="width: 780px;height: 66px;">{$detail['peitao']['xuexiao']}</textarea></td>
                                </tr>
                                <tr>
                                    <th>购物：</th>
                                    <td><textarea name="data[peitao][gouwu]" style="width: 780px;height: 66px;">{$detail['peitao']['gouwu']}</textarea></td>
                                </tr>
                                <tr>
                                    <th>医院：</th>
                                    <td><textarea name="data[peitao][yiyuan]" style="width: 780px;height: 66px;">{$detail['peitao']['yiyuan']}</textarea></td>
                                </tr>
                                <tr>
                                    <th>生活：</th>
                                    <td><textarea name="data[peitao][shenghuo]" style="width: 780px;height: 66px;">{$detail['peitao']['shenghuo']}</textarea></td>
                                </tr>
                                <tr>
                                    <th>娱乐：</th>
                                    <td><textarea name="data[peitao][yule]" style="width: 780px;height: 66px;">{$detail['peitao']['yule']}</textarea></td>
                                </tr>
                                <tr>
                                    <th>餐饮：</th>
                                    <td><textarea name="data[peitao][canyin]" style="width: 780px;height: 66px;">{$detail['peitao']['canyin']}</textarea></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>

			<div class="content_list pad_10 hidden">
				<table width="100%" cellspacing="0" class="table_form">
					<tr>
						<th width="120">seo标题 :</th>
		 				<td><input type="text" name="data[seo_title]" id="seo_title" value="{$detail.seo_title}" class="input-text" size="60"></td>
					</tr>
					<tr>
						<th>seo关键词 :</th>
						<td><input type="text" name="data[seo_keys]" id="seo_keys" value="{$detail.seo_keys}" class="input-text" size="60"></td>
					</tr>
					<tr>
						<th>seo描述 :</th>
						<td><textarea name="data[seo_desc]" id="seo_desc" cols="80" rows="8">{$detail.seo_desc}</textarea></td>
					</tr>
				</table>
			</div>
        </div>
        <input type="hidden" name="id" value="{$info.id}">
		<div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
{include file="public:footer" /}
<script src="__PUBLIC__/js/plugins/jquery.tools.min.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="__PUBLIC__/js/ueditor/uploadImg.js"></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__PUBLIC__/js/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        UE.getEditor('info',{autoFloatEnabled:false});
        upmoreimg();
    }
</script>
<script type="text/javascript">
    var check_name_url = "{:url('ajaxCheckTitle',['id'=>$info.id])}";
    $(function(){
        $('ul.J_tabs').tabs('div.J_panes > div');
        $('.J_cate_select').cate_select({type:'str'});
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_title").formValidator({onshow:"请填写小区名称",onfocus:"请填写小区名称"}).inputValidator({min:1,onerror:"请填写小区名称"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            buttons: $("#dosubmit"),
            onerror : "该小区已经存在",
            onwait : "正在验证"
        }).defaultPassed();
        $("#J_cate_id").formValidator({onshow:"请选择区域",onfocus:"请选择区域"}).inputValidator({min:1,onerror:"请选择区域"}).defaultPassed();
        $(":checkbox[name^='estate_type']").formValidator({onshow:"请选择楼盘类型",onfocus:"你至少选择1项"}).inputValidator({min:1,max:10,onerror:"请至少选择一项"}).defaultPassed();

    });
   </script>
</body>
</html>